﻿using MediatR;
using S.EarTag.API.Application.MediatorCommand.AppearanceCommand;
using S.EarTag.Infrastructure.Repository.Interface.IEarTagRepository;

namespace S.EarTag.API.Application.MediatorCommandHandler.AppearanceCommandHandler
{
    public class AppearanceBatchRemoveCommandHandler : IRequestHandler<AppearanceBatchRemoveCommand, bool>
    {
        private readonly IAppearanceModelRepository _appearanceModelRepository;
        public AppearanceBatchRemoveCommandHandler(IAppearanceModelRepository appearanceModelRepository)
        {
            _appearanceModelRepository= appearanceModelRepository;
        }
        /// <summary>
        /// 批量删除品相测量数据
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<bool> Handle(AppearanceBatchRemoveCommand request, CancellationToken cancellationToken)
        {
            return await _appearanceModelRepository.BatchDeleteAppearance(request.ids);
        }
    }
}
